package main

const (
	API_KEY = "sk-e4dec84da56b4f8f8e22a0f55aa3b6d9"
	URL     = "https://dashscope.aliyuncs.com/api/v1/services/aigc/text-generation/generation"
)

type Message struct {
	Role    string `json:"role"`
	Content string `json:"content"`
}

type Input struct {
	Messages []Message `json:"messages"`
}

type Parameters struct {
	ResultFormat   string  `json:"result_format"`
	TopP           float64 `json:"top_p"`
	Temperature    float64 `json:"temperature"`
	EnableSearch   bool    `json:"enable_search"`
	EnableThinking bool    `json:"enable_thinking"`
	ThinkingBudget int     `json:"thinking_budget"`
}

type RequestBody struct {
	Model      string     `json:"model"`
	Input      Input      `json:"input"`
	Parameters Parameters `json:"parameters"`
}

type APIResponse struct {
	Output struct {
		Choices []struct {
			Message struct {
				Content string `json:"content"`
			} `json:"message"`
		} `json:"choices"`
	} `json:"output"`
}

// 定义结构体来匹配JSON响应

type Data struct {
	Output struct {
		Choices []struct {
			Message struct {
				Content string `json:"content"`
				Role    string `json:"role"`
			} `json:"message"`
			FinishReason string `json:"finish_reason"`
		} `json:"choices"`
	} `json:"output"`
}
